package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IOrderTmpDao;
import com.financing.platform.dto.OrderTmpDTO;
import com.financing.platform.util.SqlName;
import com.financing.platform.vo.EmailTemplateUserVO;

/**
 * 
* @ClassName: OrderDaoImpl 
* @Description: 订单流程处理 
* @author chenming 
* @date 2014年8月18日 下午2:41:53 
*
 */
@Repository("orderTmpDaoImpl")
public class OrderTmpDaoImpl extends BaseDaoImpl implements IOrderTmpDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<OrderTmpDTO> queryOrderTmpList(OrderTmpDTO orderTmpDTO)
			throws Exception {
		return this.sqlMapClient.queryForList(SqlName.queryOrderTmpList, orderTmpDTO);
	}

	@Override
	public int queryOrderTmpCount(OrderTmpDTO orderTmpDTO) throws Exception {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.queryOrderTmpCount,orderTmpDTO);
	}

	@Override
	public int updateOrderTmp(OrderTmpDTO orderTmpDTO) throws Exception {
		return this.sqlMapClient.update(SqlName.updateOrderTmp,orderTmpDTO);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<EmailTemplateUserVO> queryFaOrderPerTmpForEmail()
			throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryFaOrderPerTmpForEmail);
	}

	@Override
	public List<Map<String, Object>> queryOrderTmpByProidList(OrderTmpDTO orderTmpDTO)
			throws Exception {
		return (List<Map<String, Object>>) this.sqlMapClient.queryForList(SqlName.queryOrderTmpByProList,orderTmpDTO);
	}

	@Override
	public int countOrderTmpByProidList(
			OrderTmpDTO orderTmpDTO) throws Exception {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.countOrderTmpByProList,orderTmpDTO);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<OrderTmpDTO> queryInfoByOrderTmpIds(String orderTmpIds) throws SQLException{
		return this.sqlMapClient.queryForList(SqlName.queryInfoByOrderTmpIds, orderTmpIds);
	}

}
